# 作者: 陈其志 
# 2025年02月20日19时32分16秒 
# 2716847110@qq.com
class Animal:
    def eat(self):
        print('eat')

    def drink(self):
        print('drink')

    def run(self):
        print('run')

    def sleep(self):
        print('sleep')


class Dod(Animal):
    def bark(self):
        print('bark')


class Cat(Animal):
    def miao(self):
        print(',iao,iao,iao')


class XiaoTianQuan(Dod):
    def fly(self):
        print('fly')

    # 方法重写
    def sleep(self):
        print('哮天犬要睡觉咯')

    def bark(self):
        super().bark()  # 调用父类的对象   实际是子类对象去执行父类的方法，传递的参数还是子类对象，并非新的匿名对象。
        super().sleep()
        print('像神一样瞎几把叫唤')


if __name__ == '__main__':
    wang_cai = Dod()
    wang_cai.bark()
    wang_cai.eat()
    xiao_tian_quan = XiaoTianQuan()
    xiao_tian_quan.bark()
    xiao_tian_quan.fly()
    xiao_tian_quan.sleep()
    wang_cai.sleep()
    xiao_tian_quan.bark()
